var express = require('express');
var router = express.Router();


const db = require("../public/javascripts/db")

router.post('/', function (req, res, next) {
    let info = req.body;
    console.log(info);
    let sql = "insert into repair set ?";
    db(sql, info, (result) => {
        console.log(result);
        if (result.affectedRows == 1) {
            res.json({
                code: 200,
                message: "用户添加成功"
            })
        }
    })
});

module.exports = router;